<template>
    <span class="svgIcon" v-html="svgText"></span>
</template>
<script lang="ts" setup>
import { ref, watch } from 'vue';

interface Props{
    href:string
}
const props = withDefaults(defineProps<Props>(),{
    href:()=>""
})

let svgText = ref("")
async function readSvgFile(){
    let response = await fetch(props.href)
    svgText.value = await response.text();

}
watch(()=>props.href,()=>{readSvgFile()},{deep:true,immediate:true})

</script>
<style scoped>
</style>